<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
       <h2> {{ name }}</h2>
       <h2> {{ age >= 18 ? '成年' : '未成年' }}</h2>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                name:'张三',
                age:18,
                friend:{
                    name:'李四',
                    hobby:'打游戏'
                }
            }
        })
    </script>
</body>
</html>